home *** CD-ROM | disk | FTP | other *** search
/ Compendium Deluxe 1 / LSD Compendium Deluxe 1.iso / a / programming / assembly / pencilvec.lha / pencil.s < prev    next >
Encoding:
Text File  |  1980-01-01  |  13.8 KB  |  748 lines

  1.     section    d,code_c
  2.  
  3.     include    macro
  4. hs            =    $dff000
  5. disable            =    -$78
  6. enable            =    -$7e
  7. forbid            =    -$84
  8. permit            =    -$8a
  9. openlib            =    -$228
  10. closelib        =    -$19e
  11. allocmem        =    -198
  12. freemem            =    -210
  13. dl_width        =    40
  14. dl_fill            =    1    ;0: nofill 1:fill
  15. col0            = $180
  16. col1            = $182
  17. col2            = $184
  18. col3            = $186
  19. col4            = $188
  20. col5            = $18a
  21. col6            = $18c
  22. col7            = $18e
  23. col8            = $190
  24. col9            = $192
  25. col10            = $194
  26. col11            = $196
  27. col12            = $198
  28. col13            = $19a
  29. col14            = $19c
  30. col15            = $19e
  31. col16            = $1a0
  32. col17            = $1a2
  33. col18            = $1a4
  34. col19            = $1a6
  35. col20            = $1a8
  36. col21            = $1aa
  37. col22            = $1ac
  38. col23            = $1ae
  39. col24            = $1b0
  40. col25            = $1b2
  41. col26            = $1b4
  42. col27            = $1b6
  43. col28            = $1b8
  44. col29            = $1ba
  45. col30            = $1bc
  46. col31            = $1be
  47. col32            = $1c0
  48.  
  49.  
  50.  
  51. run:
  52.     move.l    #$2800*4,d0
  53.     move.l    #$10003,d1
  54.     move.l    $4.w,a6
  55.     jsr    allocmem(a6)
  56.     move.l    d0,screen
  57.  
  58.     move.l    #$2800*4,d0
  59.     move.l    #$10003,d1
  60.     move.l    $4.w,a6
  61.     jsr    allocmem(a6)
  62.     move.l    d0,screen+4
  63.  
  64.     move.l    #$3980,d0
  65.     move.l    #$10003,d1
  66.     move.l    $4.w,a6
  67.     jsr    allocmem(a6)
  68.     move.l    d0,pl_menu
  69.  
  70. ;code-out    ***********************
  71.     lea    gfxname,a1
  72.     move.l    $4.w,a6
  73.     jsr    openlib(a6)
  74.     move.l    d0,a1
  75.     move.l    38(a1),pcop
  76.     jsr    closelib(a6)
  77.     move.l    $6c.w,pint
  78. ;code-in    ***********************
  79.     bsr.w    confp
  80.  
  81.     move.l    $4.w,a6
  82.     jsr    disable(a6)
  83.     move.l    #cint,$6c.w
  84.      move.l    #ccop,hs+cop1lch
  85.     move.w    hs+dmaconr,s_1
  86.     move.w    hs+intenar,s_1+2
  87.     move.w    #$7fff,hs+dmacon
  88.     move.w    #$7fff,hs+intena
  89.     move.w    #%1000011111001111,hs+dmacon
  90.  
  91.     move.w    #%1100000000010000,hs+intena
  92.     bset    #1,$bfe001
  93.  
  94.     move.l    #pl_logo,d0
  95.     move.w    d0,cp_plns+30
  96.     swap    d0
  97.     move.w    d0,cp_plns+26
  98.  
  99.     move.l    pl_menu,d0
  100.     move.w    d0,cp_plns2+6
  101.     swap    d0
  102.     move.w    d0,cp_plns2+2
  103.  
  104.     ;-----------------
  105. main:    cmp.b    #$ff,$dff006
  106.     bne.s    rv
  107.     bsr    vbli
  108. rv:    btst    #6,$bfe001
  109.     bne.b    main
  110. exit:    
  111. ;code-out    ***********************
  112.     move.l    pcop,hs+cop1lch
  113.     move.l    pint,$6c.w
  114.     move.w    s_1,d0
  115.     move.w    s_1+2,d1
  116.     bset    #15,d0
  117.     bset    #15,d1
  118.     move.w    #$7fff,hs+dmacon
  119.     move.w    #$7fff,hs+intena
  120.     move.w    d0,hs+dmacon
  121.     move.w    d1,hs+intena
  122.     move.l    $4.w,a6
  123.     jsr    enable(a6)
  124. ;code-in    ***********************
  125.     move.l    #$2800*4,d0
  126.     move.l    screen,a1
  127.     move.l    $4.w,a6
  128.     jsr    freemem(a6)
  129.     move.l    #$2800*4,d0
  130.     move.l    screen+4,a1
  131.     move.l    $4.w,a6
  132.     jsr    freemem(a6)
  133.     move.l    #$3980,d0
  134.     move.l    pl_menu,a1
  135.     move.l    $4.w,a6
  136.     jsr    freemem(a6)
  137.  
  138.     moveq.l    #0,d0
  139.     rts
  140.     ;----------------
  141.  
  142. vbli:    tst.b    menu_on
  143.     bne    menu_run
  144.     cmp.b    #$6d,cp_bd1
  145.     bgt    menu_off
  146.     beq    menu_setoff
  147.     add.b    #4,cp_bd1
  148. menu_run:
  149.     bsr.w    confp
  150.     bsr.w    cls
  151.     bsr    vc_rcen
  152.     bsr.w    vc_rotate
  153.     bsr.w    vc_fclk
  154.     bsr.w    vc_dr
  155.     bsr.w    vc_anh
  156.     bra    menu_bypass
  157. menu_setoff:
  158.     move.l    #ccop2,cop1lch+hs
  159.     bsr    confp2
  160.     bsr    cls2
  161.     move.b    #$71,cp_bd1
  162. at_wb:    btst    #14,dmaconr+hs
  163.     bne    at_wb
  164.     
  165.     bra    menu_bypass
  166. menu_off:
  167.  
  168. menu_bypass:
  169.     rts
  170.     ;----------------
  171. cint:    movem.l    d0-d7/a0-a6,-(sp)
  172.     btst    #4,hs+intreqr        ;verify int_source
  173.     beq.b    eint
  174.     move.w    #$10,hs+intreq        ;clear int_bit
  175.  
  176. eint:    movem.l    (sp)+,d0-d7/a0-a6
  177.     dc.w    $4ef9    
  178. pint:    dc.l    0
  179.     ;---------------
  180.  
  181. confp:    ;Configure planes *********************
  182.     move.l    screen,d0
  183.     move.w    d0,cp_plns+6
  184.     swap    d0
  185.     move.w    d0,cp_plns+2
  186.     swap    d0
  187.     add.l    #$2800,d0
  188.     move.w    d0,cp_plns+14
  189.     swap    d0
  190.     move.w    d0,cp_plns+10
  191.     swap    d0
  192.     add.l    #$2800,d0
  193.     move.w    d0,cp_plns+22
  194.     swap    d0
  195.     move.w    d0,cp_plns+18
  196.     move.l    screen+4,d0
  197.     move.l    screen,screen+4
  198.     move.l    d0,screen
  199.     rts
  200.  
  201. confp2:    ;Configure planes *********************
  202.     move.l    screen,d0
  203.     move.w    d0,cp2_plns+6
  204.     swap    d0
  205.     move.w    d0,cp2_plns+2
  206.     swap    d0
  207.     add.l    #$2800,d0
  208.     move.w    d0,cp2_plns+14
  209.     swap    d0
  210.     move.w    d0,cp2_plns+10
  211.     swap    d0
  212.     add.l    #$2800,d0
  213.     move.w    d0,cp2_plns+22
  214.     swap    d0
  215.     move.w    d0,cp2_plns+18
  216.     swap    d0
  217.     add.l    #$2800,d0
  218.     move.w    d0,cp2_plns+30
  219.     swap    d0
  220.     move.w    d0,cp2_plns+26
  221.     rts
  222.  
  223. cls:    btst    #14,hs+dmaconr
  224.     bne.b    cls
  225.     move.l    screen,hs+bltdpth
  226.     clr.w    hs+bltdmod
  227.     clr.w    hs+bltafwm
  228.     clr.w    hs+bltalwm
  229.     move.w    #$100,hs+bltcon0
  230.     clr.w    hs+bltcon1
  231.     move.w    #$c014,hs+bltsize
  232.     rts    
  233.  
  234. cls2:    btst    #14,hs+dmaconr
  235.     bne.b    cls2
  236.     move.l    screen,hs+bltdpth
  237.     clr.w    hs+bltdmod
  238.     clr.w    hs+bltafwm
  239.     clr.w    hs+bltalwm
  240.     move.w    #$100,hs+bltcon0
  241.     clr.w    hs+bltcon1
  242.     move.w    #$8014,hs+bltsize
  243.     rts    
  244.  
  245. vc_anh:    add.w    #2,xtheta
  246.     cmp.w    #361,xtheta
  247.     bne.b    vc_xok
  248.     move.w    #1,xtheta
  249. vc_xok:    add.w    #2,ytheta
  250.     cmp.w    #361,ytheta
  251.     bne.b    vc_yok
  252.     move.w    #1,ytheta
  253. vc_yok:    add.w    #2,ztheta
  254.     cmp.w    #361,ztheta
  255.     bne.b    vc_zok
  256.     move.w    #1,ztheta
  257. vc_zok:    rts
  258.  
  259. vc_rcen:
  260.     lea    vc_ca,a1
  261.     lea    vc_cr,a2
  262.     lea    sintable,a0
  263.     move.w    vc_faces,d5
  264. vc_rr:
  265.     move.w    ztheta,d6
  266.     lsl.w    #2,d6
  267.     move.w    (a0,d6),d0    ;d0 contains sin (theta)
  268.     move.w    2(a0,d6),d1    ;d1 contains cos (theta)
  269.     move.w    d0,d2
  270.     move.w    d1,d3        ;copies d0-d1 into d2-d3
  271.     muls    (a1),d0        ;d0 contains x*sin (theta)
  272.     muls    (a1),d1        ;d1 contains x*cos (theta)
  273.     muls    2(a1),d2    ;d2 contains y*sin (theta)
  274.     muls    2(a1),d3    ;d3 contains y*cos (theta)
  275.     move.w    4(a1),d4    ;skip z because z=z
  276.     sub.l    d2,d1        ;d1 now contains x (think about it...)
  277.     add.l    d0,d3        ;d3 now contains y
  278.     asr.l    #7,d1
  279.     asr.l    #7,d3
  280.     asr.l    #8,d1
  281.     asr.l    #8,d3
  282.  
  283.     move.w    ytheta,d6
  284.     lsl.w    #2,d6
  285.     move.w    (a0,d6),d0    ;d0 contains sin (theta)
  286.     move.w    2(a0,d6),d2    ;d2 contains cos (theta)
  287.     move.w    d0,d7
  288.     move.w    d2,d6        ;copies d0,d2 into d5,d6
  289.     muls    d1,d2        ;d2 contains x*cos (theta)
  290.     muls    d4,d0        ;d0 contains z*sin (theta)
  291.     muls    d4,d6        ;d6 contains z*cos (theta)
  292.     muls    d1,d7        ;d5 contains x*sin (theta)
  293.     sub.l    d0,d2        ;d2 now contains x
  294.     add.l    d6,d7        ;d7 now contains z
  295.     asr.l    #7,d2
  296.     asr.l    #7,d7
  297.     asr.l    #8,d2
  298.     asr.l    #8,d7
  299.  
  300.     move.w    xtheta,d6
  301.     lsl.w    #2,d6
  302.     move.w    (a0,d6),d0    ;d0 contains sin (theta)
  303.     move.w    2(a0,d6),d1    ;d1 contains cos (theta)
  304.     move.w    d0,d4
  305.     move.w    d1,d6        ;copies d0,d1 into d4,d6
  306.     muls    d7,d1        ;d1 contains z*cos (theta)
  307.     muls    d3,d0        ;d0 contains y*sin (theta)
  308.     muls    d3,d6        ;d6 contains y*cos (theta)
  309.     muls    d7,d4        ;d4 contains z*sin (theta)
  310.     sub.l    d0,d1        ;d1 now contains z
  311.     add.l    d6,d4        ;d4 now contains y
  312.     asr.l    #7,d1
  313.     asr.l    #7,d4
  314.     asr.l    #8,d1
  315.     asr.l    #8,d4
  316.  
  317.     move.w    d1,(a2)+
  318.     addq.w    #6,a1
  319.     dbra    d5,vc_rr
  320. vc_sr:    rts
  321.  
  322. vc_rotate:
  323.     move.l    #vc_pfp+100,vc_ds+2
  324.     lea    vc_a,a4
  325.     lea    vc_pfp,a2
  326.     lea    sintable,a0
  327. vc_nf:    move.l    (a4)+,a1
  328.     cmp.w    #0,a1
  329.     beq.w    vc_srot
  330.     move.w    (a1)+,d5
  331.     move.w    vc_dst,a3
  332.     move.w    d5,(a2)+
  333. vc_moretorot:
  334.     move.w    ztheta,d6
  335.     lsl.w    #2,d6
  336.     move.w     (a0,d6),d0    ;d0 contains sin (theta)
  337.     move.w    2(a0,d6),d1    ;d1 contains cos (theta)
  338.     move.w    d0,d2
  339.     move.w    d1,d3        ;copies d0-d1 into d2-d3
  340.     muls    (a1),d0        ;d0 contains x*sin (theta)
  341.     muls    (a1),d1        ;d1 contains x*cos (theta)
  342.     muls    2(a1),d2    ;d2 contains y*sin (theta)
  343.     muls    2(a1),d3    ;d3 contains y*cos (theta)
  344.     move.w    4(a1),d4    ;skip z because z=z
  345.     sub.l    d2,d1        ;d1 now contains x (think about it...)
  346.     add.l    d0,d3        ;d3 now contains y
  347.     asr.l    #7,d1
  348.     asr.l    #7,d3
  349.     asr.l    #8,d1
  350.     asr.l    #8,d3
  351.  
  352.     move.w    ytheta,d6
  353.     lsl.w    #2,d6
  354.     move.w    (a0,d6),d0    ;d0 contains sin (theta)
  355.     move.w    2(a0,d6),d2    ;d2 contains cos (theta)
  356.     move.w    d0,d7
  357.     move.w    d2,d6        ;copies d0,d2 into d5,d6
  358.     muls    d1,d2        ;d2 contains x*cos (theta)
  359.     muls    d4,d0        ;d0 contains z*sin (theta)
  360.     muls    d4,d6        ;d6 contains z*cos (theta)
  361.     muls    d1,d7        ;d5 contains x*sin (theta)
  362.     sub.l    d0,d2        ;d2 now contains x
  363.     add.l    d6,d7        ;d7 now contains z
  364.     asr.l    #7,d2
  365.     asr.l    #7,d7
  366.     asr.l    #8,d2
  367.     asr.l    #8,d7
  368.  
  369.     move.w    xtheta,d6
  370.     lsl.w    #2,d6
  371.     move.w    (a0,d6),d0    ;d0 contains sin (theta)
  372.     move.w    2(a0,d6),d1    ;d1 contains cos (theta)
  373.     move.w    d0,d4
  374.     move.w    d1,d6        ;copies d0,d1 into d4,d6
  375.     muls    d7,d1        ;d1 contains z*cos (theta)
  376.     muls    d3,d0        ;d0 contains y*sin (theta)
  377.     muls    d3,d6        ;d6 contains y*cos (theta)
  378.     muls    d7,d4        ;d4 contains z*sin (theta)
  379.     sub.l    d0,d1        ;d1 now contains z
  380.     add.l    d6,d4        ;d4 now contains y
  381.     asr.l    #7,d1
  382.     asr.l    #7,d4
  383.     asr.l    #8,d1
  384.     asr.l    #8,d4
  385.  
  386.     asl.l    #8,d2
  387.     asl.l    #8,d4
  388.     move.w    a3,d3
  389.     add.w    d1,d3
  390.     divs    d3,d2
  391.     divs    d3,d4
  392.  
  393.     move.w    d2,(a2)+
  394.     move.w    d4,(a2)+
  395.     addq.w    #6,a1
  396.     dbra    d5,vc_moretorot
  397.     clr.l    (a2)+
  398. vc_ds:    lea    vc_pfp+100,a2
  399.     add.w    #100,vc_ds+4
  400.     bra.w    vc_nf
  401. vc_srot:rts
  402.  
  403. vc_dr:    lea    $dff000,a5
  404.     move.l    #vc_pfs,vc_mr+2
  405. vc_mr:    lea    vc_pfs,a0
  406.     move.w    (a0),d0
  407.     tst.w    d0
  408.     beq.w    vc_fd
  409.     move.l    a0,a1
  410.     move.l    screen,a4
  411.     move.w    d0,d6
  412.     mulu    #40,d0
  413.     add.w    d0,a4
  414.     move.w    (a0),d1
  415.     move.w    2(a0),d0
  416.     move.w    -4(a0),d3
  417.     move.w    -2(a0),d2
  418.     bsr.w    vc_grad
  419.     move.l    d1,vc_lx
  420.     move.w    (a1),d1
  421.     move.w    2(a1),d0
  422.     move.w    4(a1),d3
  423.     move.w    6(a1),d2
  424.     bsr.w    vc_grad
  425.     move.l    d1,vc_rx
  426.     move.l    vc_lx,d0
  427.     move.l    vc_rx,d1
  428.     moveq    #0,d2
  429.     moveq    #0,d3
  430.     move.w    2(a0),d2    ;lx
  431.     move.w    2(a0),d3    ;rx
  432. vc_wb2:    btst    #14,dmaconr(a5)
  433.     bne.b    vc_wb2
  434.     move.w    #%11111001010,bltcon0(a5)    ;alt (b source)
  435.     clr.w    bltcon1(a5)
  436.     move.w    #-1,bltadat(a5)
  437.     ;d0=loff d1=roff d2=lcr d3=rcr d6=y
  438.     subq    #4,a0
  439.     addq    #4,a1
  440.  
  441.     subq.w    #1,d2
  442.     addq.w    #1,d3
  443.  
  444.     bra.b    vc_lp
  445. vc_blp:    cmp.w    (a0),d6
  446.     bne.s    vc_a1
  447. vc_nlfgrd:    ;change left gradient
  448.     movem.l    d1-d4,-(sp)
  449.     move.w    (a0),d1
  450.     move.w    2(a0),d0
  451.     move.w    -4(a0),d3
  452.     move.w    -2(a0),d2
  453.     cmp.w    d3,d1
  454.     blt.b    vc_ne2
  455.     movem.l    (sp)+,d1-d4
  456.     add.w    #200,vc_mr+4
  457.     bra.w    vc_mr
  458. vc_ne2:    bsr.w    vc_grad
  459.     move.l    d1,d0
  460.     movem.l    (sp)+,d1-d4
  461.     subq    #4,a0
  462. vc_a1:    cmp.w    (a1),d6
  463.     bne.s    vc_a2
  464. vc_nrtgrd:    ;change right gradient
  465.     movem.l    d0/d2-d4,-(sp)
  466.     move.w    (a1),d1
  467.     move.w    2(a1),d0
  468.     move.w    4(a1),d3
  469.     move.w    6(a1),d2
  470.     bsr.w    vc_grad
  471.     movem.l    (sp)+,d0/d2-d4
  472.     addq    #4,a1
  473. vc_a2:    lea    40(a4),a4
  474.     addq.b    #1,d6
  475. vc_lp:    swap    d2
  476.     swap    d3
  477.     add.l    d0,d2
  478.     add.l    d1,d3
  479.     swap    d2
  480.     swap    d3
  481.     move.w    d3,d4
  482.     sub.w    d2,d4
  483.     blt.b    vc_blp
  484.     move.w    d2,d5
  485.     lsr.w    #3,d5
  486.     lea    (a4,d5),a6    ;bltdpth = a6
  487.     lea    shades,a3    ;bltbpth = a3
  488.     lsl.w    #5,d4
  489.     lea    (a3,d4),a3
  490.     lsr.b    #1,d5
  491.     move.w    d3,d4
  492.     lsr.w    #4,d4
  493.     sub.b    d5,d4
  494.     lea    10238.w,a2
  495.     sub.w    d4,a2
  496.     sub.w    d4,a2
  497.     add.w    #$c1,d4
  498.     move.b    d2,d5
  499.     moveq    #-1,d7
  500.     and.b    #%1111,d5
  501.     lsr.w    d5,d7
  502.     lsl.b    #4,d5
  503.     lsl.w    #8,d5
  504.     ;a bltwait really isn't necessary. (only if your stupid!)
  505.     move.w    a2,bltcmod(a5)
  506.     move.w    a2,bltdmod(a5)
  507.     lea    -$940(a2),a2
  508.     move.w    a2,bltbmod(a5)
  509.     move.w    d7,bltafwm(a5)    ;d7
  510.     move.w    d5,bltcon1(a5)    ;d5
  511.     sub.w    d7,d7        ;Is this faster than clr.w? I think they're
  512.     move.b    d3,d5        ;both 4 clock cycles... but why not?
  513.     and.b    #%1111,d5
  514.     asr.l    d5,d7
  515.     move.w    d7,bltalwm(a5)
  516.     move.l    a3,bltbpth(a5)
  517.     move.l    a6,bltcpth(a5)
  518.     move.l    a6,bltdpth(a5)
  519.     move.w    d4,bltsize(a5)    
  520.     bra.w    vc_blp
  521. vc_fd:    rts
  522.  
  523. vc_grad:
  524. ;Kills:
  525. ;d1,d2,d3,d4,d5
  526. ;Returns:
  527. ;d3 = depth of line y1 to y2
  528. ;d1 = gradient in terms of y increment for each raster(x)
  529.     sub.w    d0,d2
  530.     sub.w    d1,d3
  531.     addq    #1,d3
  532.     ext.l    d2
  533.     move.l    d2,d4
  534.     moveq    #0,d5
  535.     btst    #30,d2
  536.     beq.b    d2notneg
  537.     neg.l    d2
  538.     bchg    #0,d5
  539. d2notneg:
  540.     btst    #15,d3
  541.     beq.b    d3notneg
  542.     neg.w    d3
  543.     bchg    #0,d5
  544. d3notneg:
  545.     divs    d3,d2            ;remainder in high word.
  546.     move.w    d2,d1
  547.     clr.w    d2
  548.     divu    d3,d2
  549.     swap    d1
  550.     move.w    d2,d1
  551.     btst    #0,d5
  552.     beq.b    pos
  553.     neg.l    d1
  554. pos:
  555.     rts
  556.  
  557. vc_fclk:
  558.     move.l    #vc_pfp,vc_ds2+2
  559.     move.l    #vc_pfs,vc_ds3+2
  560. vc_ds3:    lea    vc_pfs,a5
  561. vc_ds2:    lea    vc_pfp,a6    ;find & make clockwise points vc_pfp to vc_pfs
  562.  
  563.     tst.w    (a6)
  564.     beq.w    vc_es
  565.  
  566.     move.w    2(a6),d0
  567.     move.w    4(a6),d1
  568.     move.w    6(a6),d2
  569.     move.w    8(a6),d3
  570.     move.w    10(a6),d4
  571.     move.w    12(a6),d5
  572.     sub.w    d2,d4
  573.     sub.w    d3,d5
  574.     sub.w    d0,d2
  575.     sub.w    d1,d3
  576.     muls    d2,d5
  577.     muls    d3,d4
  578.     sub.l    d4,d5
  579.     bpl.b    vc_nok
  580.     add.w    #100,vc_ds2+4
  581.     bra.b    vc_ds2
  582.     
  583.  
  584. vc_nok:    lea    2(a6),a1
  585.     move.l    a1,a0
  586.     move.l    (a1)+,d1
  587.     add.w    #127,d1
  588.     swap    d1
  589.     add.w    #160,d1
  590. vc_nc3:    move.l    (a1)+,d0
  591.     tst.l    d0
  592.     beq.b    vc_mkclk
  593.     add.w    #127,d0
  594.     swap    d0
  595.     add.w    #160,d0
  596.     cmp.l    d0,d1
  597.     blt.b    vc_nc3
  598.     move.l    d0,d1
  599.     lea    -4(a1),a0
  600.     bra.b    vc_nc3
  601. vc_mkclk:
  602.     lea    (a5),a2
  603.     lea    (a0),a4
  604.     move.w    (a6)+,d6
  605.     lsl.w    #2,d6
  606.     addq    #4,d6
  607.     neg.w    d6
  608.     lea    (a2,d6),a3
  609.     sub.w    d6,a6    ;a6 contains pointer to last 2 co-ords...
  610. vc_nc:    move.l    (a0)+,d0
  611.     add.w    #127,d0
  612.     swap    d0
  613.     add.w    #160,d0
  614.     move.l    d0,(a2)+
  615.     move.l    d0,(a3)+
  616.     cmp.l    a6,a0
  617.     bne.b    vc_df
  618.     add.w    d6,a0
  619. vc_df:    cmp.l    a4,a0
  620.     bne.b    vc_nc
  621.     add.w    #200,vc_ds3+4    ;sw
  622.     add.w    #100,vc_ds2+4
  623.     bra.w    vc_ds3
  624. vc_es:    clr.w    (a5)
  625.     rts
  626.  
  627.  
  628.     ;---------------
  629.  
  630. ccop:    dc.w    diwstrt,$2981
  631.     dc.w    diwstop,$29c1
  632.     dc.w    ddfstrt,$38
  633.     dc.w    ddfstop,$d0
  634.  
  635. cp_config:    dc.w    bplcon0,0
  636.     dc.w    bplcon1,$0
  637.     dc.w    bplcon2,%0
  638. cp_modulo:    dc.w    $108,0,$10a,0
  639.  
  640. cp_sprite:    dc.w    $120,$0,$122,$0,$124,$0,$126,$0,$128,$0,$12a,$0,$12c
  641.     dc.w    $0,$12e,$0,$130,$0,$132,$0,$134,$0,$136,$0,$138,$0
  642.     dc.w    $13a,$0,$13c,$0,$13e,$0
  643. cp_palette:
  644.     dc.w    col0,0,col1,$3,col2,$5,col3,$7,col4,$9
  645.     dc.w    col5,$b,col6,$d
  646.     dc.w    col7,$f,col8,$f0,col9,$c0,col10,$c0,col11,$c0,col12,$c0
  647.     dc.w    col13,$c0
  648.     dc.w    col14,$c0,col15,$c0,col16,0,col17,0,col18,0,col19,0,col20,0
  649.     dc.w    col21,0,col22,0,col23,0,col24,0,col25,0,col26,0,col27,0
  650.     dc.w    col28,0,col29,0,col30,0,col31,0
  651. cp_plns:
  652.     dc.w    bpl1pth,0,bpl1ptl,0
  653.     dc.w    bpl2pth,0,bpl2ptl,0
  654.     dc.w    bpl3pth,0,bpl3ptl,0
  655.     dc.w    bpl4pth,0,bpl4ptl,0
  656.  
  657. cp_bd1:    dc.w    bplcon0,%0100000000000000
  658.  
  659.     dc.w    $7109,$fffe,col8,$af,col9,$af,col10,$af,col11,$af,col12,$af
  660.     dc.w    col13,$af,col14,$af,col15,$af
  661.     dc.w    $7209,$fffe
  662.  
  663. cp_plns2:    dc.w    bpl4pth,0,bpl4ptl,0
  664.     dc.w    $ffdf,$fffe
  665.     dc.w    intreq,$8010
  666.     dc.w    $ffff,$fffe
  667.  
  668. ccop2:    dc.w    diwstrt,$2981
  669.     dc.w    diwstop,$29c1
  670.     dc.w    ddfstrt,$3c
  671.     dc.w    ddfstop,$d4
  672.  
  673. cp2_config:    dc.w    bplcon0,%1001000000000000
  674.     dc.w    bplcon1,$0
  675.     dc.w    bplcon2,%0
  676.  
  677. cp2_modulo:    dc.w    $108,0,$10a,0
  678.  
  679. cp2_sprite:    dc.w    $120,$0,$122,$0,$124,$0,$126,$0,$128,$0,$12a,$0,$12c
  680.     dc.w    $0,$12e,$0,$130,$0,$132,$0,$134,$0,$136,$0,$138,$0
  681.     dc.w    $13a,$0,$13c,$0,$13e,$0
  682. cp2_palette:
  683.     dc.w    col0,$ccc,col1,$0,col2,$5,col3,$7,col4,$9
  684.     dc.w    col5,$b,col6,$d
  685.     dc.w    col7,$f,col8,$f0,col9,$c0,col10,$c0,col11,$c0,col12,$c0
  686.     dc.w    col13,$c0
  687.     dc.w    col14,$c0,col15,$c0,col16,0,col17,0,col18,0,col19,0,col20,0
  688.     dc.w    col21,0,col22,0,col23,0,col24,0,col25,0,col26,0,col27,0
  689.     dc.w    col28,0,col29,0,col30,0,col31,0
  690. cp2_plns:
  691.     dc.w    bpl1pth,0,bpl1ptl,0
  692.     dc.w    bpl2pth,0,bpl2ptl,0
  693.     dc.w    bpl3pth,0,bpl3ptl,0
  694.     dc.w    bpl4pth,0,bpl4ptl,0
  695.  
  696.     dc.w    intreq,$8010
  697.  
  698.     dc.w    $ffff,$fffe
  699.  
  700. pcop:    dc.l    0    ;Previous copper address
  701.  
  702. gfxname:    dc.b    "graphics.library",0
  703.     even
  704.  
  705. s_1:    dcb.l    2,0
  706.  
  707. screen:    dc.l    0,0
  708. pl_menu:    dc.l    0
  709. pl_logo:    ds.l    10*80
  710.  
  711. xtheta:    dc.w    1
  712. ytheta:    dc.w    1
  713. ztheta:    dc.w    1
  714. vc_dst:    dc.w    256
  715.  
  716. vc_cr:    dcb.w    100,0
  717.  
  718. vc_faces:    dc.w    6-1
  719. vc_a:    dc.l    vc_1a,vc_2a,vc_3a,vc_4a,vc_5a,vc_6a,0
  720. vc_ca:    dc.w    0,0,-60,60,0,0,0,0,60,-60,0,0,-60,0,0,60,0,0
  721. vc_1a:    dc.w    3
  722.     dc.w    -60,-60,-60,60,-60,-60,60,60,-60,-60,60,-60
  723. vc_2a:    dc.w    3
  724.     dc.w    60,-60,-60,60,-60,60,60,60,60,60,60,-60
  725. vc_3a:    dc.w    3
  726.     dc.w    60,-60,60,-60,-60,60,-60,60,60,60,60,60
  727. vc_4a:    dc.w    3
  728.     dc.w    -60,-60,60,-60,-60,-60,-60,60,-60,-60,60,60
  729. vc_5a:    dc.w    3
  730.     dc.w    -60,-60,60,60,-60,60,60,-60,-60,-60,-60,-60
  731. vc_6a:    dc.w    3
  732.     dc.w    -60,60,-60,60,60,-60,60,60,60,-60,60,60
  733.  
  734. vc_pfp:    dcb.w    200,0
  735.  
  736.     dcb.w    200,0
  737. vc_pfs:    dcb.w    4000,0    ;4k - just to be safe!
  738.  
  739. vc_lx:    dc.l    0
  740. vc_rx:    dc.l    0
  741.  
  742. menu_on:    dc.w    -1
  743.  
  744. shades:    incbin    "shades.bmp"
  745. sintable:    incbin    "sintable.I"
  746.  
  747.  
  748.